package br.edu.ufcg.lsd.wbis.ui.client.ui.loggedin.admin.home.info;

import br.edu.ufcg.lsd.wbis.ui.client.beans.UserInfo;
import br.edu.ufcg.lsd.wbis.ui.client.ui.GenericWindow;
import br.edu.ufcg.lsd.wbis.ui.client.ui.ResetButtonListener;
import br.edu.ufcg.lsd.wbis.ui.client.ui.loggedin.admin.Updatable;
import br.edu.ufcg.lsd.wbis.ui.client.ui.management.InfoManager;

import com.gwtext.client.widgets.Button;

/**
 * @author Renato Miceli
 */
public class UpdatePersonalInfoWindow extends GenericWindow {

	public UpdatePersonalInfoWindow(Updatable<UserInfo> parentPortlet, InfoManager<UserInfo> infoManager,
			InfoManager<UserInfo> loggedInfoManager) {
		this.setTitle("Update Personal Info");
		this.setWidth(350);
		this.setHeight(170);
		this.setMinWidth(200);
		this.setMinHeight(100);

		final UpdateInfoFormPanel updateInfoPanel = new UpdateInfoFormPanel(infoManager, loggedInfoManager);

		this.addButton(new Button("Update", new UpdateInfoButtonListener(this, updateInfoPanel, parentPortlet, infoManager, loggedInfoManager)));
		this.addButton(new Button("Restore", new ResetButtonListener(updateInfoPanel)));
		this.add(updateInfoPanel);

		this.show();
	}

}
